Optimal. Leaf size=38 \[ -a x+\frac {b \cos (c+d x)}{d}+\frac {b \sec (c+d x)}{d}+\frac {a \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {2801, 3554, 8,
2670, 14} \begin {gather*} \frac {a \tan (c+d x)}{d}-a x+\frac {b \cos (c+d x)}{d}+\frac {b \sec (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 14
Rule 2670
Rule 2801
Rule 3554
Rubi steps
\begin {align*} \int (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx &=\int \left (a \tan ^2(c+d x)+b \sin (c+d x) \tan ^2(c+d x)\right ) \, dx\\ &=a \int \tan ^2(c+d x) \, dx+b \int \sin (c+d x) \tan ^2(c+d x) \, dx\\ &=\frac {a \tan (c+d x)}{d}-a \int 1 \, dx-\frac {b \text {Subst}\left (\int \frac {1-x^2}{x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-a x+\frac {a \tan (c+d x)}{d}-\frac {b \text {Subst}\left (\int \left (-1+\frac {1}{x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-a x+\frac {b \cos (c+d x)}{d}+\frac {b \sec (c+d x)}{d}+\frac {a \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 47, normalized size = 1.24 \begin {gather*} -\frac {a \tan ^{-1}(\tan (c+d x))}{d}+\frac {b \cos (c+d x)}{d}+\frac {b \sec (c+d x)}{d}+\frac {a \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 59, normalized size = 1.55
method | result | size |
derivativedivides | \(\frac {a \left (\tan \left (d x +c \right )-d x -c \right )+b \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )}{d}\) | \(59\) |
default | \(\frac {a \left (\tan \left (d x +c \right )-d x -c \right )+b \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )}{d}\) | \(59\) |
risch | \(-a x +\frac {b \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {b \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 i a +2 b \,{\mathrm e}^{i \left (d x +c \right )}}{d \left (1+{\mathrm e}^{2 i \left (d x +c \right )}\right )}\) | \(70\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.54, size = 39, normalized size = 1.03 \begin {gather*} -\frac {{\left (d x + c - \tan \left (d x + c\right )\right )} a - b {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 47, normalized size = 1.24 \begin {gather*} -\frac {a d x \cos \left (d x + c\right ) - b \cos \left (d x + c\right )^{2} - a \sin \left (d x + c\right ) - b}{d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right ) \tan ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1008 vs.
\(2 (38) = 76\).
time = 10.58, size = 1008, normalized size = 26.53 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.60, size = 55, normalized size = 1.45 \begin {gather*} -a\,x-\frac {2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+4\,b}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________